from django import template

register = template.Library()

@register.filter
def limit_array(value, limit):
	if len(value) >= limit:
		return value[:limit]
	else:
		return value